-----------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/juanpablouribetrujillo/My Drive (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE/analys
> is/../logs/universe_regressions.log
  log type:  text
 opened on:  24 Jun 2024, 22:24:56

. *-------------------------****** OUTPUT SETTINGS *****---------------------;
. *Some settings that are common for the set of plots on this dofile;
.  local pdf_plot_settings =      `"scale(*1.5) ymtick(##4) leg(off) xtitle("")"';

. *settings for latex tables ;
. local tex_settigns  = `" prehead(\begin{table}[!htb]\centering
>         \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
>         \caption{@title}
>         \setlength{\tabcolsep}{3pt}
>         \begin{tabular}{l*{@span}{c}}
>         \hline\hline)
>         postfoot(\hline\hline
>         \multicolumn{@span}{l}{\footnotesize Standard errors clustered by state in parenthesis.  }\\
>         \multicolumn{@span}{l}{\footnotesize @starlegend.   }
>         \end{tabular}\end{table})       "'      ;

.         local tex_settigns_adj  = `" 
>         prehead(\begin{table}[!htb]\centering
>         \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
>         \begin{adjustbox}{max width=\textwidth,max totalheight=\textheight}
>         \caption{@title}
>         \begin{tabular}{l*{@span}{c}}
>         \hline\hline)
>         postfoot(\hline\hline
>         \multicolumn{@span}{l}{\footnotesize Standard errors clustered by state in parenthesis.  }\\
>         \multicolumn{@span}{l}{\footnotesize @starlegend.   }
>         \end{tabular}\end{adjustbox}\end{table})                "'      ;

.         *----------------------------------------------------------------------------------;
. ****************************************;
.         *Define price index ;
. use "../data/state_year_all_80_15.dta", clear  ;

. *---------------------------------------------------;
. * - Generate variables and general cleanings ;
. *---------------------------------------------------;
. do "_setup_expenditure.do";

. /******************************************************************
> 
> setup_expenditure.do
> 
> Subroutine to calculate expenditure variables for all analysis programs;
> 
> mt 20190506
> *******************************************************************/
. # delim ;  
delimiter now ;
. * expenditure on length and IRI from SF12a. Check that categories are right. Can we break apart ROW?;
. *conversion factor to get to 10^6 2010 dollars;
. gen deflate= 1/(ppiaco_2010*10);

. *gen deflate= 1;
. *consolidate rural and urban SF12a variables that we need;
. local rur_urb_list      "exp_eng_row_IH                 exp_row_IH              exp_eng_IH              e
> xp_new_cons_IH
>                         exp_relocation_IH               exp_recons_IH           exp_recons_add_IH       e
> xp_recons_noadd_IH
>                         exp_maj_wide_IH                 exp_R3_IH               exp_R3_min_wide_IH      e
> xp_R3_rehab_rest_IH    
>                         exp_R3_resurf_IH
>                         exp_new_bridge_IH exp_bridgereplacement_IH exp_majorbridgerehab_IH exp_minorbridg
> erehab_IH exp_bridge_IH
>                         ";

. foreach exp_var of local rur_urb_list{;
  2.                 replace `exp_var'_urban=cond(`exp_var'_urban==.,0,`exp_var'_urban);
  3.                 replace `exp_var'_rural=cond(`exp_var'_rural==.,0,`exp_var'_rural);
  4.                 gen `exp_var'_all = `exp_var'_urban + `exp_var'_rural;
  5.                 drop `exp_var'_urban `exp_var'_rural;
  6.                 };
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)

. *consolidate SF12a variables into nominal construction and resurfacing for pre and post 1998;
. *NB: exp_new_cons_IH_all and exp_maj_wide_IH_all are common to pre and post 1998 construction;
. gen exp_L_IH_SF12a_n_old=       exp_eng_row_IH_all + exp_new_cons_IH_all + exp_maj_wide_IH_all;

. gen exp_IRI_IH_SF12a_n_old=     exp_recons_IH_all  + exp_R3_IH_all;

.  gen exp_L_IH_SF12a_n_new=      exp_row_IH_all     + exp_eng_IH_all      + exp_new_cons_IH_all  + exp_rel
> ocation_IH_all + exp_maj_wide_IH_all;

.                         gen exp_IRI_IH_SF12a_n_new=     exp_recons_add_IH  + exp_recons_noadd_IH + exp_R3
> _min_wide_IH   + exp_R3_rehab_rest_IH  + exp_R3_resurf_IH;

. * Do the same for bridge expenditure ;
. gen exp_bridge_IH_SF12a_n_new=cond( year>1998,
>                                                                         exp_new_bridge_IH_all+exp_bridger
> eplacement_IH_all+exp_majorbridgerehab_IH_all+exp_minorbridgerehab_IH_all,.);
(931 missing values generated)

.                                                                         gen exp_bridge_IH_SF12a_n_old=con
> d( year<=1998,
>                                                                         exp_bridge_IH_all,.);
(833 missing values generated)

. *diagnostics -- should all be zero -- this test won't work for construction;
. sum exp_IRI_IH_SF12a_n_new exp_IRI_IH_SF12a_n_old if year>1998;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_IRI_IH~w |        833    75901.17    142629.8          0    1142287
exp_IRI_IH~d |        833           0           0          0          0

. sum exp_IRI_IH_SF12a_n_new exp_IRI_IH_SF12a_n_old if year<=1998;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_IRI_IH~w |        931           0           0          0          0
exp_IRI_IH~d |        931    47717.58    68779.22          0     560136

. *consolidate pre and post 1998 variable construction;
. gen exp_IRI_IH_SF12a_n =        cond(year>1998, exp_IRI_IH_SF12a_n_new, exp_IRI_IH_SF12a_n_old);

. gen exp_L_IH_SF12a_n =          cond(year>1998, exp_L_IH_SF12a_n_new, exp_L_IH_SF12a_n_old);

. gen exp_bridge_IH_SF12a_n =             cond(year>1998, exp_bridge_IH_SF12a_n_new, exp_bridge_IH_SF12a_n_
> old);

. *clean up -- save reloacation;
. gen temp = exp_relocation_IH_all;

. gen temp2 =exp_row_IH_all ;

. foreach exp_var of local rur_urb_list{;
  2.                 drop `exp_var'_all;
  3.                 };

.                 drop *_new *_old;

. rename temp exp_relocation_IH_all_n;

.  rename temp2 exp_row_IH_all_n ;

. *calculate total IH and SF12a maintenance;
. gen exp_IH_total_SF12_n = exp_IH_mtn_all + exp_IH_k_all;
(180 missing values generated)

. gen exp_IH_mtn_SF12a_n = exp_IH_total_SF12_n - exp_IRI_IH_SF12a_n - exp_L_IH_SF12a_n -exp_bridge_IH_SF12a
> _n;
(180 missing values generated)

. sum exp_IH_mtn_SF12a_n, d ;

                     exp_IH_mtn_SF12a_n
-------------------------------------------------------------
      Percentiles      Smallest
 1%       -34577        -796329
 5%            0        -387772
10%         4495        -242600       Obs               1,584
25%        13109        -198478       Sum of wgt.       1,584

50%     33878.59                      Mean           108119.7
                        Largest       Std. dev.      250930.4
75%     94553.93        2017193
90%       252167        2062267       Variance       6.30e+10
95%       424198        3278198       Skewness       5.866655
99%      1313969        3303381       Kurtosis         52.087

. replace exp_IH_mtn_SF12a_n= cond(exp_IH_mtn_SF12a_n<0,0,exp_IH_mtn_SF12a_n );
(27 real changes made)

. sum exp_IH_mtn_SF12a_n, d ;

                     exp_IH_mtn_SF12a_n
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%         4495              0       Obs               1,584
25%        13109              0       Sum of wgt.       1,584

50%     33878.59                      Mean           109822.3
                        Largest       Std. dev.      248973.5
75%     94553.93        2017193
90%       252167        2062267       Variance       6.20e+10
95%       424198        3278198       Skewness       6.026436
99%      1313969        3303381       Kurtosis       53.45254

. ;
. *convert to real 2010 USD 10^6;
. *NB: deflate calculated in calling program;
. rename app_IH app_IH_n;

. rename exp_IH_mtn_all exp_IH_mtn_SF12_n;

. ren rev_grand_total_mt rev_grand_total_mt_n;

. ren rev_total_h rev_total_h_n;

. ren rev_total_mt rev_total_mt_n ;

. ren rev_total_m_fuel_h rev_total_m_fuel_h_n ;

. local real_list "exp_IH_total_SF12 exp_IH_mtn_SF12a exp_IRI_IH_SF12a exp_L_IH_SF12a app_IH exp_IH_mtn_SF1
> 2 exp_relocation_IH_all 
>                                  rev_grand_total_mt rev_total_h rev_total_mt rev_total_m_fuel_h
>                                  exp_bridge_IH_SF12a exp_row_IH_all
>                                  ";

. foreach exp_var of local real_list{;
  2.                 gen `exp_var'_r=deflate*`exp_var'_n;
  3.                 drop `exp_var'_n;
  4.                 };
(180 missing values generated)
(180 missing values generated)
(900 missing values generated)
(180 missing values generated)
(996 missing values generated)
(228 missing values generated)
(996 missing values generated)
(228 missing values generated)

.         forvalues i=1(1)5{;
  2.                                 gen deflate_L`i'= 1/(ppiaco_2010_L`i'*10);
  3.                 ren L`i'FHWA_apport_LW L`i'FHWA_apport_LW_n;
  4.                 gen L`i'FHWA_apport_LW_r=deflate_L`i'*L`i'FHWA_apport_LW_n;
  5.                 drop L`i'FHWA_apport_LW_n;
  6. };
(132 missing values generated)
(180 missing values generated)
(228 missing values generated)
(276 missing values generated)
(324 missing values generated)

.                                                 *label and drop superflous expenditure data;
. label var       exp_IH_total_SF12_r     "Total IH exp SF12 real";

. label var       exp_IH_mtn_SF12_r       "Total IH maint exp SF12 real";

. label var       exp_IH_mtn_SF12a_r      "Total IH maint exp SF12a real";

.  label var      exp_IRI_IH_SF12a_r      "Total IH IRI exp SF12a real";

.  label var      exp_L_IH_SF12a_r        "Total IH L exp SF12a real";

. label var       app_IH_r                "Total IH approp real";

. label var       exp_relocation_IH_all   "Total IH exp relocation, >1998";

. label var   rev_grand_total_mt_r          "Total revenue mass transit account real [source: FE9 p2 ]";

. label var   rev_total_mt_r        "Total revenue highway and mass transit account real [source: FE9 p2 ]"
> ;

. label var   rev_total_h  "Total revenue highway account real [source: FE9 p2 ]";

. label var rev_total_m_fuel_h                     "Total Revenue motor fuel  (Highway motor fuel) [source:
>  FE9 p1 ]";

.         *drop exp_IH_k_rural-exp_subtotal_mtn_urban;
. exit;

end of do-file

. do "_cleaning_and_new_variables.do";

. 
. 
. 
. 
. # d ; 
delimiter now ;
. *label variables to mathc the names in the tables ;
. label var exp_L_IH_SF12a_r "\(I^{L}_{st} \)";

. label var  exp_IRI_IH_SF12a_r "\( Y^L\:in\:IRI \)";

. label var  exp_IH_mtn_SF12a_r "\( Y^L\: in\: Maint.\)";

. *make lagged expenditure and appropriations;
. sort state year;

. gen L1exp_L_IH_SF12a_r=cond(
>                         state[_n]==year[_n-1],
>                         year[_n-1]==year[_n]-1,
>                         exp_L_IH_SF12a_r[_n-1],.);
(1 missing value generated)

. gen L5app_IH_r=cond(
>                         state[_n]==year[_n-5],
>                         year[_n-5]==year[_n]-5,
>                         app_IH_r[_n-5],.);
(901 missing values generated)

.                         gen L1app_IH_r=cond(
>                         state[_n]==year[_n-1],
>                         year[_n-1]==year[_n]-1,
>                         app_IH_r[_n-1],.);
(900 missing values generated)

.                                                                         *calculate first differences in m
> iles and IRI;
. *local D_vars "u_iri_IH u_iri_urban u_iri_rural u_lane_miles_IH u_lane_miles_rural u_lane_miles_urban";
. local D_vars u_lane_miles_IH  u_lane_miles_rural u_lane_miles_urban u_miles_IH;

. sort state year;

. foreach varname of local D_vars{;
  2.                 gen D`varname'=cond(
>                                 state[_n]==state[_n-1]&
>                                 `varname'[_n-1]!=.&`varname'[_n]!=.&
>                                 `varname'[_n-1]!=0&`varname'[_n]!=0&
>                                 year[_n-1]==year[_n]-1,
>                                 `varname'[_n]-`varname'[_n-1],.);
  3.                                 };
(342 missing values generated)
(402 missing values generated)
(346 missing values generated)
(342 missing values generated)

.                                 *Create average width of lane miles ;
. gen u_width_IH= u_lane_miles_IH/u_miles_IH;
(293 missing values generated)

. label var u_width_IH "Avergae width of lanes";

.                                 *create expantion lanes in existing segments and new segments;
.                                 gen Du_expantion_miles_IH=cond(
>                                 state[_n]==state[_n-1]&
>                                 u_lane_miles_IH[_n-1]!=.&u_lane_miles_IH[_n]!=.&
>                                 u_miles_IH[_n-1]!=.&u_miles_IH[_n]!=.&
>                                 year[_n-1]==year[_n]-1,
>                                 Du_lane_miles_IH - Du_miles_IH*u_width_IH[_n-1],
>                                 .);
(342 missing values generated)

. *replace Du_expantion_miles_IH=0 if Du_expantion_miles_IH<0;
.                         label var Du_expantion_miles_IH "Expansion miles";

.                                 //note: The assumption to create this variable is that the new miles occu
> rs at mean width ;
> 
> gen sh_new_lm=cond(state[_n]==state[_n-1]&
>                                 u_lane_miles_IH[_n-1]!=.&u_lane_miles_IH[_n]!=.&
>                                 u_miles_IH[_n-1]!=.&u_miles_IH[_n]!=.&
>                                 year[_n-1]==year[_n]-1, Du_miles_IH*u_width_IH/Du_lane_miles_IH,.) ;
(494 missing values generated)

. *replace sh_new_lm=1 if Du_expantion_miles_IH==0 & Du_lane_miles_IH>0;
. label var sh_new_lm "Share of new lane miles in new segments";

. gen sh_exp_lm= Du_expantion_miles_IH/Du_lane_miles_IH;
(494 missing values generated)

. label var sh_exp_lm "Share of new lane miles that are expantions";

. *dropping missing d_lane_miles saves trouble later;
. * keep all years with lagge appropriations;
. * N.B.: Nothing strange here.  SF12a missing <1984;
. drop if year>2008|year<1980;
(343 observations deleted)

. drop if u_lane_miles_IH==.;
(0 observations deleted)

. drop if u_lane_miles_IH==0;
(0 observations deleted)

. drop if u_lane_miles_IH<0;
(0 observations deleted)

. *drop DC;
. drop if state==11;
(29 observations deleted)

. * time, for estimating trends;
. gen time =year-1984;

. gen time2 =time^2;

. gen time3 =time^3;

. label var time2 "\(time^2\)" ;

. label var time3 "\(time^3\)" ;

. *TIME TREND DUMMIES;
. gen     periods=1 if  year>=1984&year<=1989;
(1,104 missing values generated)

. replace periods=2 if  year>=1990&year<=1994;
(240 real changes made)

. replace periods=3 if  year>=1995&year<=1999;
(240 real changes made)

. replace periods=4 if  year>=2000&year<=2004;
(240 real changes made)

. replace periods=5 if  year>=2005&year<=2008;
(192 real changes made)

. tab year periods, m ;

           |                              periods
 Book year |         1          2          3          4          5          . |     Total
-----------+------------------------------------------------------------------+----------
      1980 |         0          0          0          0          0         48 |        48 
      1981 |         0          0          0          0          0         48 |        48 
      1982 |         0          0          0          0          0         48 |        48 
      1983 |         0          0          0          0          0         48 |        48 
      1984 |        48          0          0          0          0          0 |        48 
      1985 |        48          0          0          0          0          0 |        48 
      1986 |        48          0          0          0          0          0 |        48 
      1987 |        48          0          0          0          0          0 |        48 
      1988 |        48          0          0          0          0          0 |        48 
      1989 |        48          0          0          0          0          0 |        48 
      1990 |         0         48          0          0          0          0 |        48 
      1991 |         0         48          0          0          0          0 |        48 
      1992 |         0         48          0          0          0          0 |        48 
      1993 |         0         48          0          0          0          0 |        48 
      1994 |         0         48          0          0          0          0 |        48 
      1995 |         0          0         48          0          0          0 |        48 
      1996 |         0          0         48          0          0          0 |        48 
      1997 |         0          0         48          0          0          0 |        48 
      1998 |         0          0         48          0          0          0 |        48 
      1999 |         0          0         48          0          0          0 |        48 
      2000 |         0          0          0         48          0          0 |        48 
      2001 |         0          0          0         48          0          0 |        48 
      2002 |         0          0          0         48          0          0 |        48 
      2003 |         0          0          0         48          0          0 |        48 
      2004 |         0          0          0         48          0          0 |        48 
      2005 |         0          0          0          0         48          0 |        48 
      2006 |         0          0          0          0         48          0 |        48 
      2007 |         0          0          0          0         48          0 |        48 
      2008 |         0          0          0          0         48          0 |        48 
-----------+------------------------------------------------------------------+----------
     Total |       288        240        240        240        192        192 |     1,392 

. label define periods 1 "1984-1989"
>                                         2 "1990-1994"
>                                         3 "1995-1999"
>                                         4 "2000-2004"
>                                         5 "2005-2008";

. label values periods periods;

. # d cr ;
delimiter now cr
. 
. 
end of do-file

. do "_programs_universe";

. 
. # delim ;  
delimiter now ;
. ****************************************;
.         *-This program is used to add a row indicating the use of sample id when using areg;
. cap program drop add_lab_FE;

. program define add_lab_FE;
  1.         matrix V = [vecdiag(e(V)),1];
  2.         matrix V=diag(V);
  3.         matrix b=[e(b),1];
  4.         matrix colnames b= `:  colnames e(b)' `1';
  5.         matrix colnames V= `:  colnames e(V)' `1';
  6.         erepost b=b V=V ,rename;
  7. end;

. ****************************************;
.         *-This program calculates summary stats for regression tables;
. cap program drop sum_stats;

. program define sum_stats;
  1.         sum Du_lane_miles_IH ;
  2.         estadd  scalar mean_Du_lane_miles_IH =r(mean) ;
  3.         sum exp_L_IH_SF12a_r ;
  4.         estadd  scalar mean_exp_L_IH_SF12a_r=r(mean) ;
  5. end;

. ****************************************;
.         *-This program plots year dummies for slope of PPF against time;
. cap program drop plot_dummies;

. program define plot_dummies;
  1.         *settings for plots;
.         local pdf_plot_settings =       "bgcolor(white) 
>                                         graphregion(color(white)) plotregion(ls(none))  
>                                         xmtick(1984(1)2008)  
>                                         xlabel(1984(4)2008)
>                                         ymtick(##5)
>                                         scale(*1.5)  
>                                         legend(off)";
  2.         preserve;
  3.         *save se to disk;
.         mata: se=sqrt(diagonal(st_matrix("e(V)")));
  4.  // converts e(V) into se and placed in mata matrix se
>         clear;
  5.         getmata se, force ;
  6.         gen counter=_n;
  7.         save se,replace;
  8.                 *save coefficients to disk and organize;
.         mat beta=e(b);
  9.         mat list beta;
 10.         clear;
 11.         set obs 1;
 12.         display"1";
 13.         svmat double beta;
 14.         *file in memory is a single row year effects from regression;
.         gen dummy=1;
 15.         display"1";
 16.         reshape long beta,  i(dummy) j(year);
 17.         gen counter=_n;
 18.         *merge with se;
.         merge 1:1 counter using se;
 19.         drop if counter>25;
 20.         drop _merge counter;
 21.         *just keep year X expenditure coefficients;
.         drop if year==.;
 22.         replace year = year+1983;
 23.         sort year;
 24.         *file in memory gives bin, mean y and se;
.         gen up5 = beta+1.96*se;
 25.         gen down5 = beta-1.96*se;
 26.         save beta, replace;
 27.         *file in memory is a list of year by year inverse prices and CI's;
.         twoway (rcap up5 down5 year, lstyle(ci)) (scatter beta year),`pdf_plot_settings' xtitle("") ;
 28.         graph export "temp_t.pdf", replace;
 29.         erase se.dta;
 30.         erase beta.dta;
 31.         save "temp_betas.dta", replace;
 32.         restore;
 33. end;

. ****************************************;
.         *-This program plots year dummies for DL vs expenditure;
. cap program drop plot_DLdummies ;

. program define plot_DLdummies;
  1.         *settings for plots;
.         local pdf_plot_settings =       "bgcolor(white) 
>                                         graphregion(color(white)) plotregion(ls(none))  
>                                         xmtick(1980(1)2008)  
>                                         xlabel(1980(10)2010)
>                                         ymtick(##5)
>                                         scale(*1.5)  
>                                         legend(off)";
  2.         preserve;
  3.         *save se to disk;
.         mata: se=sqrt(diagonal(st_matrix("e(V)")));
  4.  // converts e(V) into se and placed in mata matrix se
>         clear;
  5.         getmata se, force ;
  6.         gen counter=_n;
  7.         save se,replace;
  8.                 *save coefficients to disk and organize;
.         mat beta=e(b);
  9.         mat list beta;
 10.         clear;
 11.         set obs 1;
 12.         svmat double beta;
 13.         *file in memory is a single row year effects from regression;
.         gen dummy=1;
 14.         reshape long beta,  i(dummy) j(exp);
 15.         gen counter=_n;
 16.         *merge with se;
.         merge 1:1 counter using se;
 17.         drop if counter>7;
 18.         drop _merge counter;
 19.                 *just keep year X expenditure coefficients;
.         drop if exp==.;
 20.         replace exp = exp*100-50;
 21.         sort exp;
 22.         *file in memory gives bin, mean y and se;
.         gen up5 = beta+1.96*se;
 23.         gen down5 = beta-1.96*se;
 24.         save beta, replace;
 25.         *file in memory is a list of year by year inverse prices and CI's;
.         twoway (rcap up5 down5 exp, lstyle(ci)) (scatter beta exp), xtitle("") `pdf_plot_settings';
 26.         graph export "temp_t.pdf", replace;
 27.         erase se.dta;
 28.         erase beta.dta;
 29.         restore;
 30. end;

. ****************************************;
. 
end of do-file

. tab year periods ;

           |                        periods
 Book year | 1984-1989  1990-1994  1995-1999  2000-2004  2005-2008 |     Total
-----------+-------------------------------------------------------+----------
      1984 |        48          0          0          0          0 |        48 
      1985 |        48          0          0          0          0 |        48 
      1986 |        48          0          0          0          0 |        48 
      1987 |        48          0          0          0          0 |        48 
      1988 |        48          0          0          0          0 |        48 
      1989 |        48          0          0          0          0 |        48 
      1990 |         0         48          0          0          0 |        48 
      1991 |         0         48          0          0          0 |        48 
      1992 |         0         48          0          0          0 |        48 
      1993 |         0         48          0          0          0 |        48 
      1994 |         0         48          0          0          0 |        48 
      1995 |         0          0         48          0          0 |        48 
      1996 |         0          0         48          0          0 |        48 
      1997 |         0          0         48          0          0 |        48 
      1998 |         0          0         48          0          0 |        48 
      1999 |         0          0         48          0          0 |        48 
      2000 |         0          0          0         48          0 |        48 
      2001 |         0          0          0         48          0 |        48 
      2002 |         0          0          0         48          0 |        48 
      2003 |         0          0          0         48          0 |        48 
      2004 |         0          0          0         48          0 |        48 
      2005 |         0          0          0          0         48 |        48 
      2006 |         0          0          0          0         48 |        48 
      2007 |         0          0          0          0         48 |        48 
      2008 |         0          0          0          0         48 |        48 
-----------+-------------------------------------------------------+----------
     Total |       288        240        240        240        192 |     1,200 

. drop if year<1984 ;
(192 observations deleted)

. drop if exp_L_IH_SF12a_r==.;
(0 observations deleted)

. drop if exp_L_IH_SF12a_r==0;
(29 observations deleted)

. drop if exp_L_IH_SF12a_r<0;
(0 observations deleted)

. sum app_IH_r exp_L_IH_SF12a_r;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    app_IH_r |        716    112.6006    97.22099   7.157321    633.818
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

. *------------------------------------------------;
. * Run the regressions ;
. *------------------------------------------------;
. *All regressions;
. *IV Definition:;
. *---------------------------------;
. local IV L4FHWA_apport_LW_r;

. label var time2 "\( t^2\)";

. gen exp_L_IH_SF12a_rXtime=exp_L_IH_SF12a_r*time;

. gen exp_L_IH_SF12a_rXtime2=exp_L_IH_SF12a_r*time2;

. gen `IV'Xtime =`IV'*time;

. gen `IV'_sample=1 if `IV'!=.;

. gen time_92=time-8 if year>1991;
(363 missing values generated)

. tab time_92 year;

           |                                  Book year
   time_92 |      1992       1993       1994       1995       1996       1997       1998 |     Total
-----------+-----------------------------------------------------------------------------+----------
         0 |        47          0          0          0          0          0          0 |        47 
         1 |         0         45          0          0          0          0          0 |        45 
         2 |         0          0         46          0          0          0          0 |        46 
         3 |         0          0          0         46          0          0          0 |        46 
         4 |         0          0          0          0         48          0          0 |        48 
         5 |         0          0          0          0          0         48          0 |        48 
         6 |         0          0          0          0          0          0         48 |        48 
         7 |         0          0          0          0          0          0          0 |        48 
         8 |         0          0          0          0          0          0          0 |        48 
         9 |         0          0          0          0          0          0          0 |        48 
        10 |         0          0          0          0          0          0          0 |        48 
        11 |         0          0          0          0          0          0          0 |        48 
        12 |         0          0          0          0          0          0          0 |        48 
        13 |         0          0          0          0          0          0          0 |        48 
        14 |         0          0          0          0          0          0          0 |        48 
        15 |         0          0          0          0          0          0          0 |        48 
        16 |         0          0          0          0          0          0          0 |        48 
-----------+-----------------------------------------------------------------------------+----------
     Total |        47         45         46         46         48         48         48 |       808 


           |                                  Book year
   time_92 |      1999       2000       2001       2002       2003       2004       2005 |     Total
-----------+-----------------------------------------------------------------------------+----------
         0 |         0          0          0          0          0          0          0 |        47 
         1 |         0          0          0          0          0          0          0 |        45 
         2 |         0          0          0          0          0          0          0 |        46 
         3 |         0          0          0          0          0          0          0 |        46 
         4 |         0          0          0          0          0          0          0 |        48 
         5 |         0          0          0          0          0          0          0 |        48 
         6 |         0          0          0          0          0          0          0 |        48 
         7 |        48          0          0          0          0          0          0 |        48 
         8 |         0         48          0          0          0          0          0 |        48 
         9 |         0          0         48          0          0          0          0 |        48 
        10 |         0          0          0         48          0          0          0 |        48 
        11 |         0          0          0          0         48          0          0 |        48 
        12 |         0          0          0          0          0         48          0 |        48 
        13 |         0          0          0          0          0          0         48 |        48 
        14 |         0          0          0          0          0          0          0 |        48 
        15 |         0          0          0          0          0          0          0 |        48 
        16 |         0          0          0          0          0          0          0 |        48 
-----------+-----------------------------------------------------------------------------+----------
     Total |        48         48         48         48         48         48         48 |       808 


           |            Book year
   time_92 |      2006       2007       2008 |     Total
-----------+---------------------------------+----------
         0 |         0          0          0 |        47 
         1 |         0          0          0 |        45 
         2 |         0          0          0 |        46 
         3 |         0          0          0 |        46 
         4 |         0          0          0 |        48 
         5 |         0          0          0 |        48 
         6 |         0          0          0 |        48 
         7 |         0          0          0 |        48 
         8 |         0          0          0 |        48 
         9 |         0          0          0 |        48 
        10 |         0          0          0 |        48 
        11 |         0          0          0 |        48 
        12 |         0          0          0 |        48 
        13 |         0          0          0 |        48 
        14 |        48          0          0 |        48 
        15 |         0         48          0 |        48 
        16 |         0          0         48 |        48 
-----------+---------------------------------+----------
     Total |        48         48         48 |       808 

. gen exp_L_IH_SF12a_rXtime_92=exp_L_IH_SF12a_r*time_92;
(363 missing values generated)

. local IV L4FHWA_apport_LW_r;

. gen `IV'Xtime_92 =`IV'*time_92;
(363 missing values generated)

. label var time "\(t\) ";

. label var `IV'Xtime " \( app_{(t-4)} t \) ";

. label var L4FHWA_apport_LW_r "\( app_{(t-4)}\)";

. tab year;

  Book year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1984 |         44        3.76        3.76
       1985 |         46        3.93        7.69
       1986 |         47        4.01       11.70
       1987 |         45        3.84       15.54
       1988 |         44        3.76       19.30
       1989 |         47        4.01       23.31
       1990 |         45        3.84       27.16
       1991 |         45        3.84       31.00
       1992 |         47        4.01       35.01
       1993 |         45        3.84       38.86
       1994 |         46        3.93       42.78
       1995 |         46        3.93       46.71
       1996 |         48        4.10       50.81
       1997 |         48        4.10       54.91
       1998 |         48        4.10       59.01
       1999 |         48        4.10       63.11
       2000 |         48        4.10       67.21
       2001 |         48        4.10       71.31
       2002 |         48        4.10       75.41
       2003 |         48        4.10       79.50
       2004 |         48        4.10       83.60
       2005 |         48        4.10       87.70
       2006 |         48        4.10       91.80
       2007 |         48        4.10       95.90
       2008 |         48        4.10      100.00
------------+-----------------------------------
      Total |      1,171      100.00

. label var  exp_L_IH_SF12a_rXtime "\(I^{L}_{st} t \)  ";

. label var  exp_L_IH_SF12a_rXtime2 "\(I^{L}_{st} t^2\)  ";

. local listcontinous "c.time cont Baseline" ;

. local listcontinous2 "c.time_+_c.time2 cont_2 " ;

. local listdiscrete  "ib2.periods dum Periods" ;

.         eststo ,prefix(filter_): reg Du_lane_miles_IH exp_L_IH_SF12a_r,  cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(1, 47)          =       4.21
                                                Prob > F          =     0.0459
                                                R-squared         =     0.0292
                                                Root MSE          =     57.029

                                     (Std. err. adjusted for 48 clusters in state)
----------------------------------------------------------------------------------
                 |               Robust
Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
exp_L_IH_SF12a_r |   .0472202   .0230269     2.05   0.046      .000896    .0935444
           _cons |   16.31448    3.43821     4.75   0.000     9.397697    23.23127
----------------------------------------------------------------------------------
(filter_1 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.         eststo ,prefix(filter_): reg Du_lane_miles_IH exp_L_IH_SF12a_r  io36.state,   cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(1, 47)          =          .
                                                Prob > F          =          .
                                                R-squared         =     0.1557
                                                Root MSE          =     54.264

                                     (Std. err. adjusted for 48 clusters in state)
----------------------------------------------------------------------------------
                 |               Robust
Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
exp_L_IH_SF12a_r |   -.000804   .0133591    -0.06   0.952     -.027679     .026071
                 |
           state |
        ARIZONA  |  -18.44545   8.020616    -2.30   0.026    -34.58085   -2.310053
       ARKANSAS  |  -10.67268   8.053433    -1.33   0.192    -26.87409    5.528739
     CALIFORNIA  |   19.58863   10.27946     1.91   0.063    -1.090981    40.26825
       COLORADO  |   -21.8168      8.025    -2.72   0.009    -37.96102   -5.672587
    CONNECTICUT  |  -25.29938   8.066973    -3.14   0.003    -41.52803    -9.07072
       DELAWARE  |  -29.97202   8.089552    -3.71   0.001     -46.2461   -13.69794
        FLORIDA  |   54.40881   9.342544     5.82   0.000     35.61403    73.20358
        GEORGIA  |   22.26097   8.099386     2.75   0.008     5.967109    38.55483
          IDAHO  |  -25.76102   8.060999    -3.20   0.002    -41.97766   -9.544381
       ILLINOIS  |   59.26186   8.811178     6.73   0.000     41.53605    76.98766
        INDIANA  |  -22.34096   8.031835    -2.78   0.008    -38.49893   -6.182993
           IOWA  |  -22.31327   8.024343    -2.78   0.008    -38.45617   -6.170375
         KANSAS  |  -14.71476   8.042831    -1.83   0.074    -30.89485    1.465328
       KENTUCKY  |  -3.027156   8.021422    -0.38   0.708    -19.16418    13.10986
      LOUISIANA  |   .5448563   8.023405     0.07   0.946    -15.59615    16.68586
          MAINE  |  -21.08088   8.083861    -2.61   0.012    -37.34351   -4.818253
       MARYLAND  |  -4.726375   8.027303    -0.59   0.559    -20.87523    11.42248
  MASSACHUSETTS  |  -23.62006   11.67642    -2.02   0.049    -47.10999   -.1301402
       MICHIGAN  |  -2.798469   8.118899    -0.34   0.732    -19.13159    13.53465
      MINNESOTA  |   -19.1633   8.021127    -2.39   0.021    -35.29973   -3.026876
    MISSISSIPPI  |  -26.48668   8.025717    -3.30   0.002    -42.63234   -10.34102
       MISSOURI  |  -9.768101   8.020518    -1.22   0.229     -25.9033    6.367099
        MONTANA  |  -18.46141   8.065695    -2.29   0.027    -34.68749   -2.235319
       NEBRASKA  |  -27.91342   8.075322    -3.46   0.001    -44.15888   -11.66797
         NEVADA  |  -26.31319   8.024385    -3.28   0.002    -42.45617   -10.17021
  NEW HAMPSHIRE  |  -28.35604    8.07993    -3.51   0.001    -44.61076   -12.10132
     NEW JERSEY  |  -12.60112   8.446379    -1.49   0.142    -29.59304    4.390802
     NEW MEXICO  |  -29.22063   8.082019    -3.62   0.001    -45.47955    -12.9617
       NEW YORK  |          0  (omitted)
 NORTH CAROLINA  |   55.47596   8.245974     6.73   0.000      38.8872    72.06472
   NORTH DAKOTA  |   -30.7873   8.101211    -3.80   0.000    -47.08484   -14.48977
           OHIO  |   9.530974   8.101067     1.18   0.245     -6.76627    25.82822
       OKLAHOMA  |  -26.97637     8.0232    -3.36   0.002    -43.11697   -10.83578
         OREGON  |  -26.46476   8.042615    -3.29   0.002    -42.64441    -10.2851
   PENNSYLVANIA  |   19.27017   8.657888     2.23   0.031     1.852742    36.68759
   RHODE ISLAND  |  -31.87983   8.053018    -3.96   0.000    -48.08041   -15.67925
 SOUTH CAROLINA  |  -9.243131   8.030278    -1.15   0.256    -25.39797    6.911705
   SOUTH DAKOTA  |  -29.07604   8.091625    -3.59   0.001    -45.35429   -12.79779
      TENNESSEE  |   2.058452   8.023436     0.26   0.799    -14.08262    18.19952
          TEXAS  |   26.31314   9.731097     2.70   0.010     6.736699    45.88958
           UTAH  |   3.997055   8.020625     0.50   0.621    -12.13836    20.13247
        VERMONT  |   -31.3254   8.108445    -3.86   0.000    -47.63749   -15.01331
       VIRGINIA  |   5.064045   8.154311     0.62   0.538    -11.34031     21.4684
     WASHINGTON  |  -10.37518   8.283054    -1.25   0.217    -27.03853    6.288175
  WEST VIRGINIA  |  -13.59658   8.030815    -1.69   0.097    -29.75249    2.559338
      WISCONSIN  |  -1.338421   8.056103    -0.17   0.869    -17.54521    14.86837
        WYOMING  |  -29.68125   8.080358    -3.67   0.001    -45.93683   -13.42567
                 |
           _cons |   31.30595    8.11186     3.86   0.000       14.987    47.62491
----------------------------------------------------------------------------------
(filter_2 stored)

.                 sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.         eststo ,prefix(filter_): reg Du_lane_miles_IH   time   exp_L_IH_SF12a_r exp_L_IH_SF12a_rXtime   ,
>    cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(3, 47)          =       9.66
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0632
                                                Root MSE          =     56.069

                                          (Std. err. adjusted for 48 clusters in state)
---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
                 time |  -.6487459   .2909676    -2.23   0.031    -1.234097   -.0633946
     exp_L_IH_SF12a_r |   .1135356   .0328204     3.46   0.001     .0475094    .1795618
exp_L_IH_SF12a_rXtime |  -.0045444   .0011559    -3.93   0.000    -.0068698   -.0022189
                _cons |   22.92805   5.725465     4.00   0.000      11.4099     34.4462
---------------------------------------------------------------------------------------
(filter_3 stored)

.                 eststo ,prefix(filter_): reg Du_lane_miles_IH    time time2  exp_L_IH_SF12a_r exp_L_IH_SF
> 12a_rXtime  exp_L_IH_SF12a_rXtime2   ,   cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(5, 47)          =       8.08
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0739
                                                Root MSE          =     55.798

                                           (Std. err. adjusted for 48 clusters in state)
----------------------------------------------------------------------------------------
                       |               Robust
      Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------------+----------------------------------------------------------------
                  time |   .0401562   1.055969     0.04   0.970    -2.084179    2.164491
                 time2 |   -.020747   .0377704    -0.55   0.585    -.0967312    .0552373
      exp_L_IH_SF12a_r |   .2018585   .0554494     3.64   0.001     .0903088    .3134082
 exp_L_IH_SF12a_rXtime |  -.0210396    .009467    -2.22   0.031    -.0400847   -.0019945
exp_L_IH_SF12a_rXtime2 |   .0006139   .0003375     1.82   0.075     -.000065    .0012928
                 _cons |   17.49415   6.826222     2.56   0.014     3.761562    31.22674
----------------------------------------------------------------------------------------
(filter_4 stored)

.                 ren time time_old;

.         ren exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_old;

.         ren exp_L_IH_SF12a_rXtime_92 exp_L_IH_SF12a_rXtime;

.         ren time_92 time;

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.                 eststo ,prefix(filter_): reg Du_lane_miles_IH   time   exp_L_IH_SF12a_r exp_L_IH_SF12a_rX
> time   if year>1991 ,   cluster(state);

Linear regression                               Number of obs     =        808
                                                F(3, 47)          =       3.28
                                                Prob > F          =     0.0291
                                                R-squared         =     0.0318
                                                Root MSE          =     51.669

                                          (Std. err. adjusted for 48 clusters in state)
---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
                 time |  -.4111529   .3119446    -1.32   0.194    -1.038704    .2163987
     exp_L_IH_SF12a_r |   .0511992   .0363349     1.41   0.165    -.0218971    .1242955
exp_L_IH_SF12a_rXtime |  -.0018099   .0021707    -0.83   0.409    -.0061769    .0025571
                _cons |   15.26146   4.710666     3.24   0.002     5.784827     24.7381
---------------------------------------------------------------------------------------
(filter_5 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.         ren  exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_92;

.         ren time time_92 ;

.         ren time_old  time;

.         ren  exp_L_IH_SF12a_rXtime_old exp_L_IH_SF12a_rXtime;

.                 eststo ,prefix(filter_): reg Du_lane_miles_IH    time   exp_L_IH_SF12a_r exp_L_IH_SF12a_r
> Xtime  io36.state ,   cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(3, 47)          =          .
                                                Prob > F          =          .
                                                R-squared         =     0.1843
                                                Root MSE          =     53.384

                                          (Std. err. adjusted for 48 clusters in state)
---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
                 time |  -.6584781   .2649389    -2.49   0.017    -1.191466   -.1254897
     exp_L_IH_SF12a_r |   .0642656   .0256304     2.51   0.016     .0127039    .1158273
exp_L_IH_SF12a_rXtime |  -.0040274   .0012185    -3.31   0.002    -.0064787   -.0015762
                      |
                state |
             ARIZONA  |  -18.40208   8.326298    -2.21   0.032    -35.15243   -1.651728
            ARKANSAS  |  -7.898566   8.428487    -0.94   0.353     -24.8545    9.057364
          CALIFORNIA  |   13.83671   10.49252     1.32   0.194    -7.271531    34.94494
            COLORADO  |  -20.95849    8.37072    -2.50   0.016    -37.79821   -4.118773
         CONNECTICUT  |  -25.94126   8.399018    -3.09   0.003     -42.8379   -9.044612
            DELAWARE  |  -27.16883   8.430266    -3.22   0.002    -44.12834   -10.20932
             FLORIDA  |   50.79951   9.568428     5.31   0.000     31.55031     70.0487
             GEORGIA  |   21.85585   8.448311     2.59   0.013     4.860038    38.85166
               IDAHO  |  -23.89844   8.359562    -2.86   0.006     -40.7157   -7.081167
            ILLINOIS  |   63.33663   9.137009     6.93   0.000     44.95534    81.71793
             INDIANA  |  -20.20449   8.391339    -2.41   0.020    -37.08569   -3.323296
                IOWA  |   -20.0883   8.406184    -2.39   0.021    -36.99936    -3.17724
              KANSAS  |  -12.76025   8.373686    -1.52   0.134    -29.60593    4.085436
            KENTUCKY  |  -.3522202   8.448847    -0.04   0.967    -17.34911    16.64467
           LOUISIANA  |   1.612593   8.460047     0.19   0.850    -15.40683    18.63201
               MAINE  |  -18.71491   8.393735    -2.23   0.031    -35.60093   -1.828897
            MARYLAND  |  -3.313807   8.463128    -0.39   0.697    -20.33942    13.71181
       MASSACHUSETTS  |  -25.57127    11.2161    -2.28   0.027    -48.13514   -3.007396
            MICHIGAN  |  -6.100746   8.500068    -0.72   0.476    -23.20068    10.99919
           MINNESOTA  |  -20.33647   8.300105    -2.45   0.018    -37.03413   -3.638813
         MISSISSIPPI  |  -24.13659   8.415949    -2.87   0.006    -41.06729   -7.205879
            MISSOURI  |  -8.286947   8.376234    -0.99   0.328    -25.13776    8.563862
             MONTANA  |  -16.70988   8.350835    -2.00   0.051    -33.50959    .0898361
            NEBRASKA  |  -25.48476      8.399    -3.03   0.004    -42.38137   -8.588153
              NEVADA  |  -24.17306   8.405048    -2.88   0.006    -41.08184   -7.264284
       NEW HAMPSHIRE  |  -26.19642   8.378262    -3.13   0.003    -43.05131   -9.341532
          NEW JERSEY  |  -15.75541   8.810457    -1.79   0.080    -33.47976    1.968945
          NEW MEXICO  |  -26.88708   8.391311    -3.20   0.002    -43.76822   -10.00594
            NEW YORK  |          0  (omitted)
      NORTH CAROLINA  |   55.55091   8.611108     6.45   0.000     38.22759    72.87422
        NORTH DAKOTA  |  -28.27128   8.405678    -3.36   0.002    -45.18132   -11.36124
                OHIO  |   10.40264   8.486579     1.23   0.226     -6.67015    27.47544
            OKLAHOMA  |  -25.46918    8.39692    -3.03   0.004    -42.36161   -8.576759
              OREGON  |  -24.98192    8.34122    -2.99   0.004    -41.76229   -8.201554
        PENNSYLVANIA  |    15.1465   9.033634     1.68   0.100    -3.026823    33.31983
        RHODE ISLAND  |  -28.15195   8.514778    -3.31   0.002    -45.28147   -11.02242
      SOUTH CAROLINA  |  -7.980063   8.337771    -0.96   0.343     -24.7535    8.793369
        SOUTH DAKOTA  |  -26.56078    8.40535    -3.16   0.003    -43.47017   -9.651397
           TENNESSEE  |   2.447213   8.304079     0.29   0.770    -14.25844    19.15287
               TEXAS  |   20.83005   9.982074     2.09   0.042     .7487128     40.9114
                UTAH  |   4.608252    8.33707     0.55   0.583    -12.16377    21.38027
             VERMONT  |  -28.60012   8.422802    -3.40   0.001    -45.54461   -11.65562
            VIRGINIA  |   4.372961   8.507174     0.51   0.610    -12.74127    21.48719
          WASHINGTON  |  -11.89534   8.633753    -1.38   0.175    -29.26421     5.47353
       WEST VIRGINIA  |  -13.10008   8.295462    -1.58   0.121     -29.7884    3.588235
           WISCONSIN  |    1.28737   8.416495     0.15   0.879    -15.64443    18.21917
             WYOMING  |  -27.27896   8.396678    -3.25   0.002     -44.1709   -10.38703
                      |
                _cons |   36.64805      8.396     4.36   0.000     19.75747    53.53862
---------------------------------------------------------------------------------------
(filter_6 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.                 eststo ,prefix(filter_): reg Du_lane_miles_IH    time time2  exp_L_IH_SF12a_r exp_L_IH_SF
> 12a_rXtime  exp_L_IH_SF12a_rXtime2  io36.state ,   cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(5, 47)          =          .
                                                Prob > F          =          .
                                                R-squared         =     0.1865
                                                Root MSE          =     53.359

                                           (Std. err. adjusted for 48 clusters in state)
----------------------------------------------------------------------------------------
                       |               Robust
      Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------------+----------------------------------------------------------------
                  time |  -1.595848   .9403843    -1.70   0.096    -3.487658    .2959607
                 time2 |   .0409541   .0319183     1.28   0.206    -.0232573    .1051655
      exp_L_IH_SF12a_r |   .0832705   .0567524     1.47   0.149    -.0309007    .1974416
 exp_L_IH_SF12a_rXtime |  -.0071971   .0078691    -0.91   0.365    -.0230277    .0086335
exp_L_IH_SF12a_rXtime2 |   .0001133    .000258     0.44   0.662    -.0004057    .0006324
                       |
                 state |
              ARIZONA  |  -18.42058   8.356955    -2.20   0.032     -35.2326   -1.608554
             ARKANSAS  |   -7.39402   8.774047    -0.84   0.404    -25.04513    10.25709
           CALIFORNIA  |   13.70595   10.45531     1.31   0.196    -7.327422    34.73932
             COLORADO  |  -20.61619   8.627041    -2.39   0.021    -37.97155   -3.260817
          CONNECTICUT  |   -25.7184   8.591479    -2.99   0.004    -43.00223   -8.434575
             DELAWARE  |  -26.65962    8.75439    -3.05   0.004    -44.27118   -9.048055
              FLORIDA  |   49.80875   9.581007     5.20   0.000     30.53425    69.08325
              GEORGIA  |    21.8806   8.531498     2.56   0.014     4.717441    39.04376
                IDAHO  |  -23.50821    8.61371    -2.73   0.009    -40.83676   -6.179658
             ILLINOIS  |   62.49602   8.923919     7.00   0.000     44.54341    80.44863
              INDIANA  |  -19.86203   8.616869    -2.31   0.026    -37.19694   -2.527125
                 IOWA  |  -19.69486   8.678156    -2.27   0.028    -37.15306   -2.236663
               KANSAS  |   -12.7243   8.489855    -1.50   0.141    -29.80368    4.355087
             KENTUCKY  |  -.1726737   8.647195    -0.02   0.984    -17.56859    17.22324
            LOUISIANA  |   2.112198   8.627952     0.24   0.808      -15.245     19.4694
                MAINE  |  -18.26497   8.684661    -2.10   0.041    -35.73625   -.7936831
             MARYLAND  |  -2.915625   8.569427    -0.34   0.735    -20.15509    14.32384
        MASSACHUSETTS  |  -24.37368   12.01327    -2.03   0.048    -48.54127   -.2060931
             MICHIGAN  |  -6.025989   8.592274    -0.70   0.487    -23.31141    11.25944
            MINNESOTA  |   -20.7171   8.256847    -2.51   0.016    -37.32774   -4.106468
          MISSISSIPPI  |   -23.7816   8.677624    -2.74   0.009    -41.23872   -6.324468
             MISSOURI  |  -8.049198   8.543586    -0.94   0.351    -25.23668     9.13828
              MONTANA  |  -16.40703   8.536009    -1.92   0.061    -33.57927       .7652
             NEBRASKA  |  -24.99465   8.726955    -2.86   0.006    -42.55102   -7.438281
               NEVADA  |  -24.24981   8.510406    -2.85   0.006    -41.37053   -7.129077
        NEW HAMPSHIRE  |  -25.75911   8.662009    -2.97   0.005    -43.18483     -8.3334
           NEW JERSEY  |  -16.34339   8.783597    -1.86   0.069    -34.01371    1.326928
           NEW MEXICO  |  -26.43851   8.681992    -3.05   0.004    -43.90443   -8.972597
             NEW YORK  |          0  (omitted)
       NORTH CAROLINA  |   55.52915   8.680148     6.40   0.000     38.06695    72.99136
         NORTH DAKOTA  |    -27.767   8.737618    -3.18   0.003    -45.34482   -10.18918
                 OHIO  |   10.69611   8.726538     1.23   0.226    -6.859423    28.25164
             OKLAHOMA  |  -25.16727   8.617283    -2.92   0.005      -42.503   -7.831529
               OREGON  |  -24.62302   8.581588    -2.87   0.006    -41.88695   -7.359089
         PENNSYLVANIA  |   14.60405   9.021422     1.62   0.112    -3.544711    32.75281
         RHODE ISLAND  |  -27.61721   8.795624    -3.14   0.003    -45.31172   -9.922693
       SOUTH CAROLINA  |  -7.747133   8.493194    -0.91   0.366    -24.83324     9.33897
         SOUTH DAKOTA  |  -26.03725   8.757329    -2.97   0.005    -43.65473   -8.419778
            TENNESSEE  |   2.613705   8.432104     0.31   0.758     -14.3495    19.57691
                TEXAS  |    20.0001   9.980372     2.00   0.051    -.0778173    40.07802
                 UTAH  |    4.61687   8.374421     0.55   0.584    -12.23029    21.46403
              VERMONT  |  -28.10173   8.752944    -3.21   0.002    -45.71038   -10.49308
             VIRGINIA  |   4.146984     8.4923     0.49   0.628    -12.93732    21.23129
           WASHINGTON  |   -12.5039   8.563964    -1.46   0.151    -29.73237    4.724577
        WEST VIRGINIA  |  -13.12932   8.302897    -1.58   0.121     -29.8326    3.573949
            WISCONSIN  |   1.752848   8.727641     0.20   0.842     -15.8049     19.3106
              WYOMING  |  -26.81037    8.70443    -3.08   0.003    -44.32142   -9.299312
                       |
                 _cons |   39.34995   10.05931     3.91   0.000     19.11323    59.58667
----------------------------------------------------------------------------------------
(filter_7 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.                 ren time time_old;

.         ren exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_old;

.         ren exp_L_IH_SF12a_rXtime_92 exp_L_IH_SF12a_rXtime;

.         ren time_92 time;

.         eststo ,prefix(filter_): reg Du_lane_miles_IH    time   exp_L_IH_SF12a_r exp_L_IH_SF12a_rXtime  i
> o36.state  if year>1991,   cluster(state);

Linear regression                               Number of obs     =        808
                                                F(3, 47)          =          .
                                                Prob > F          =          .
                                                R-squared         =     0.1537
                                                Root MSE          =      49.75

                                          (Std. err. adjusted for 48 clusters in state)
---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
                 time |  -.1071726   .2886896    -0.37   0.712    -.6879412     .473596
     exp_L_IH_SF12a_r |   .0332773   .0229246     1.45   0.153    -.0128411    .0793956
exp_L_IH_SF12a_rXtime |  -.0036887   .0014863    -2.48   0.017    -.0066788   -.0006986
                      |
                state |
             ARIZONA  |  -23.63228   18.82675    -1.26   0.216    -61.50682    14.24226
            ARKANSAS  |   -2.13162   18.78002    -0.11   0.910    -39.91216    35.64892
          CALIFORNIA  |   18.70262   21.39943     0.87   0.387    -24.34747    61.75271
            COLORADO  |  -26.26332   18.95169    -1.39   0.172    -64.38921    11.86257
         CONNECTICUT  |  -28.89131    19.1331    -1.51   0.138    -67.38215    9.599522
            DELAWARE  |  -30.39918   18.73412    -1.62   0.111    -68.08736    7.289002
             FLORIDA  |   34.42386   20.20066     1.70   0.095    -6.214638    75.06235
             GEORGIA  |  -7.783975    19.1482    -0.41   0.686    -46.30519    30.73724
               IDAHO  |  -28.83501   18.74411    -1.54   0.131    -66.54329    8.873273
            ILLINOIS  |   36.17537   19.91372     1.82   0.076    -3.885862     76.2366
             INDIANA  |  -23.32621   18.79698    -1.24   0.221    -61.14086    14.48843
                IOWA  |  -33.42409   18.88032    -1.77   0.083     -71.4064    4.558225
              KANSAS  |  -27.55487   18.78647    -1.47   0.149    -65.34839    10.23864
            KENTUCKY  |  -2.417032   18.87681    -0.13   0.899    -40.39227    35.55821
           LOUISIANA  |  -17.73249   18.88403    -0.94   0.353    -55.72226    20.25729
               MAINE  |   -29.2791   18.72522    -1.56   0.125    -66.94937    8.391177
            MARYLAND  |  -26.73707   18.85934    -1.42   0.163    -64.67717    11.20302
       MASSACHUSETTS  |  -35.33061   24.72851    -1.43   0.160    -85.07796    14.41674
            MICHIGAN  |  -27.51834   19.18703    -1.43   0.158    -66.11767    11.08098
           MINNESOTA  |  -28.09112   18.77969    -1.50   0.141    -65.87099    9.688754
         MISSISSIPPI  |   -25.3964   18.85731    -1.35   0.185    -63.33242    12.53961
            MISSOURI  |  -25.26544   18.90217    -1.34   0.188    -63.29171    12.76083
             MONTANA  |  -31.66267   18.73442    -1.69   0.098    -69.35146    6.026114
            NEBRASKA  |  -26.73795   18.74662    -1.43   0.160    -64.45129    10.97539
              NEVADA  |  -26.09391   18.88504    -1.38   0.174    -64.08571    11.89788
       NEW HAMPSHIRE  |  -31.17051   18.73548    -1.66   0.103    -68.86142    6.520409
          NEW JERSEY  |  -8.954134   19.60007    -0.46   0.650    -48.38439    30.47612
          NEW MEXICO  |  -28.98078   18.72932    -1.55   0.128    -66.65931    8.697756
            NEW YORK  |          0  (omitted)
      NORTH CAROLINA  |   43.10617   19.38114     2.22   0.031     4.116342    82.09599
        NORTH DAKOTA  |  -30.94991   18.71465    -1.65   0.105    -68.59893    6.699109
                OHIO  |   16.28734   19.25532     0.85   0.402    -22.44936    55.02405
            OKLAHOMA  |  -28.27015   18.89759    -1.50   0.141     -66.2872    9.746905
              OREGON  |  -29.21235   18.78554    -1.56   0.127    -67.00397    8.579276
        PENNSYLVANIA  |   21.45923   19.79929     1.08   0.284    -18.37181    61.29028
        RHODE ISLAND  |  -31.53321   18.76747    -1.68   0.100    -69.28849     6.22208
      SOUTH CAROLINA  |  -7.038831   18.79951    -0.37   0.710    -44.85856     30.7809
        SOUTH DAKOTA  |  -28.43614   18.72921    -1.52   0.136    -66.11445    9.242166
           TENNESSEE  |  -.6998452   18.83452    -0.04   0.971    -38.59001    37.19032
               TEXAS  |   1.545834   20.70361     0.07   0.941    -40.10446    43.19613
                UTAH  |  -17.76453   18.82867    -0.94   0.350    -55.64292    20.11386
             VERMONT  |  -31.70823   18.70902    -1.69   0.097    -69.34592    5.929465
            VIRGINIA  |  -4.403055   19.14262    -0.23   0.819    -42.91304    34.10693
          WASHINGTON  |  -13.65008   19.20304    -0.71   0.481    -52.28162    24.98146
       WEST VIRGINIA  |  -27.39988   18.75526    -1.46   0.151     -65.1306    10.33084
           WISCONSIN  |  -6.153697   18.77467    -0.33   0.745    -43.92345    31.61606
             WYOMING  |  -31.64654   18.73364    -1.69   0.098    -69.33377    6.040693
                      |
                _cons |    32.5079    18.5457     1.75   0.086    -4.801237    69.81703
---------------------------------------------------------------------------------------
(filter_8 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.                         ren  exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_92;

.         ren time time_92 ;

.         ren time_old  time;

.         ren  exp_L_IH_SF12a_rXtime_old exp_L_IH_SF12a_rXtime;

.                                 eststo ,prefix(filter_): ivreg2  Du_lane_miles_IH        time   (exp_L_IH
> _SF12a_r exp_L_IH_SF12a_rXtime=`IV' `IV'Xtime),   robust first  ffirst  saverf saverfprefix(rf_3) savefir
> st  savefprefix(fs_3) cluster(state);

Stored estimation results
-------------------------
--------------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------------
rf_3Du_lan~H | ivreg2    Du_lane_mi~H       4  Reduced-form regression: Du_lane_miles_IH
fs_3exp_L_~r | ivreg2    exp_L_IH_S~r       4  First-stage regression: exp_L_IH_SF12a_r
fs_3exp_L_~e | ivreg2    exp_L_IH_S~e       4  First-stage regression: exp_L_IH_SF12a_rXtime
--------------------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of exp_L_IH_SF12a_r:

Statistics robust to heteroskedasticity and clustering on state
Number of obs =                   1171
Number of clusters (state) =        48
-----------------------------------------------------------------------------------------
                        |               Robust
       exp_L_IH_SF12a_r | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
     L4FHWA_apport_LW_r |   224.2882   68.91031     3.25   0.001     89.08625    359.4901
L4FHWA_apport_LW_rXtime |  -.8383388   3.373166    -0.25   0.804    -7.456486    5.779808
                   time |   .1525115    1.86634     0.08   0.935    -3.509245    3.814268
                  _cons |   6.530591    33.9703     0.19   0.848    -60.11911    73.18029
-----------------------------------------------------------------------------------------
F test of excluded instruments:
  F(  2,    47) =    22.98
  Prob > F      =   0.0000
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    47) =    49.79
  Prob > F      =   0.0000


First-stage regression of exp_L_IH_SF12a_rXtime:

Statistics robust to heteroskedasticity and clustering on state
Number of obs =                   1171
Number of clusters (state) =        48
-----------------------------------------------------------------------------------------
                        |               Robust
  exp_L_IH_SF12a_rXtime | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
     L4FHWA_apport_LW_r |   421.5097   745.1341     0.57   0.572    -1040.442    1883.462
L4FHWA_apport_LW_rXtime |   179.2853   53.05041     3.38   0.001     75.20041    283.3701
                   time |   16.21514   29.71952     0.55   0.585    -42.09453    74.52481
                  _cons |  -105.0699   374.0783    -0.28   0.779    -839.0111    628.8713
-----------------------------------------------------------------------------------------
F test of excluded instruments:
  F(  2,    47) =    24.18
  Prob > F      =   0.0000
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    47) =    51.88
  Prob > F      =   0.0000



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  2,    47)  P-val | SW Chi-sq(  1) P-val | SW F(  1,    47)
exp_L_IH_SF1 |      22.98    0.0000 |       50.98   0.0000 |       49.79
exp_L_IH_SF1 |      24.18    0.0000 |       53.12   0.0000 |       51.88

NB: first-stage test statistics cluster-robust

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                   10% maximal IV size             19.93
                                   15% maximal IV size             11.59
                                   20% maximal IV size              8.75
                                   25% maximal IV size              7.25
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for i.i.d. errors only.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Kleibergen-Paap rk LM statistic          Chi-sq(1)=8.67     P-val=0.0032

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                     225.32
Kleibergen-Paap Wald rk F statistic                                20.65

Stock-Yogo weak ID test critical values for K1=2 and L1=2:
                                   10% maximal IV size              7.03
                                   15% maximal IV size              4.58
                                   20% maximal IV size              3.95
                                   25% maximal IV size              3.63
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(2,47)=       10.82     P-val=0.0001
Anderson-Rubin Wald test           Chi-sq(2)=     22.16     P-val=0.0000
Stock-Wright LM S statistic        Chi-sq(2)=     18.15     P-val=0.0001

NB: Underidentification, weak identification and weak-identification-robust
    test statistics cluster-robust

Number of clusters             N_clust  =         48
Number of observations               N  =       1171
Number of regressors                 K  =          4
Number of endogenous regressors      K1 =          2
Number of instruments                L  =          4
Number of excluded instruments       L1 =          2

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on state

Number of clusters (state) =        48                Number of obs =     1171
                                                      F(  3,    47) =    15.01
                                                      Prob > F      =   0.0000
Total (centered) SS     =  3916390.209                Centered R2   =   0.0196
Total (uncentered) SS   =  4529345.865                Uncentered R2 =   0.1523
Residual SS             =  3839530.194                Root MSE      =    57.26

---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
----------------------+----------------------------------------------------------------
     exp_L_IH_SF12a_r |   .1583621   .0457935     3.46   0.001     .0686084    .2481157
exp_L_IH_SF12a_rXtime |  -.0036567   .0025029    -1.46   0.144    -.0085624     .001249
                 time |   -.827069    .281493    -2.94   0.003    -1.378785   -.2753529
                _cons |   17.31585   5.042157     3.43   0.001     7.433401    27.19829
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):              8.668
                                                   Chi-sq(1) P-val =    0.0032
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              225.316
                         (Kleibergen-Paap rk Wald F statistic):         20.648
Stock-Yogo weak ID test critical values: 10% maximal IV size              7.03
                                         15% maximal IV size              4.58
                                         20% maximal IV size              3.95
                                         25% maximal IV size              3.63
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         exp_L_IH_SF12a_r exp_L_IH_SF12a_rXtime
Included instruments: time
Excluded instruments: L4FHWA_apport_LW_r L4FHWA_apport_LW_rXtime
------------------------------------------------------------------------------
(filter_9 stored)

.         ren time time_old;

.         ren exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_old;

.         ren exp_L_IH_SF12a_rXtime_92 exp_L_IH_SF12a_rXtime;

.         ren time_92 time;

.         ren `IV'Xtime `IV'Xtime_old;

.         ren `IV'Xtime_92 `IV'Xtime;

.                 eststo ,prefix(filter_): ivreg2  Du_lane_miles_IH        time   (exp_L_IH_SF12a_r exp_L_I
> H_SF12a_rXtime=`IV' `IV'Xtime) if year>1991,   robust first  ffirst  saverf saverfprefix(rf_3) savefirst 
>  savefprefix(fs_3) cluster(state);

Stored estimation results
-------------------------
--------------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------------
rf_3Du_lan~H | ivreg2    Du_lane_mi~H       4  Reduced-form regression: Du_lane_miles_IH
fs_3exp_L_~r | ivreg2    exp_L_IH_S~r       4  First-stage regression: exp_L_IH_SF12a_r
fs_3exp_L_~e | ivreg2    exp_L_IH_S~e       4  First-stage regression: exp_L_IH_SF12a_rXtime
--------------------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of exp_L_IH_SF12a_r:

Statistics robust to heteroskedasticity and clustering on state
Number of obs =                    808
Number of clusters (state) =        48
-----------------------------------------------------------------------------------------
                        |               Robust
       exp_L_IH_SF12a_r | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
     L4FHWA_apport_LW_r |   225.4782   112.8773     2.00   0.046     3.909238    447.0472
L4FHWA_apport_LW_rXtime |  -1.564422   9.428401    -0.17   0.868    -20.07161    16.94277
                   time |  -1.496547   4.782002    -0.31   0.754    -10.88323    7.890135
                  _cons |    24.1015   53.08138     0.45   0.650    -80.09295    128.2959
-----------------------------------------------------------------------------------------
F test of excluded instruments:
  F(  2,    47) =    24.71
  Prob > F      =   0.0000
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    47) =    14.86
  Prob > F      =   0.0004


First-stage regression of exp_L_IH_SF12a_rXtime:

Statistics robust to heteroskedasticity and clustering on state
Number of obs =                    808
Number of clusters (state) =        48
-----------------------------------------------------------------------------------------
                        |               Robust
  exp_L_IH_SF12a_rXtime | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
     L4FHWA_apport_LW_r |   351.7018   410.9207     0.86   0.392    -454.9023    1158.306
L4FHWA_apport_LW_rXtime |   164.4654   55.62885     2.96   0.003     55.27052    273.6604
                   time |    16.9607   30.48033     0.56   0.578    -42.86973    76.79112
                  _cons |  -63.93021   195.6456    -0.33   0.744    -447.9667    320.1062
-----------------------------------------------------------------------------------------
F test of excluded instruments:
  F(  2,    47) =    23.87
  Prob > F      =   0.0000
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    47) =    25.21
  Prob > F      =   0.0000



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  2,    47)  P-val | SW Chi-sq(  1) P-val | SW F(  1,    47)
exp_L_IH_SF1 |      24.71    0.0000 |       15.24   0.0001 |       14.86
exp_L_IH_SF1 |      23.87    0.0000 |       25.85   0.0000 |       25.21

NB: first-stage test statistics cluster-robust

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                   10% maximal IV size             19.93
                                   15% maximal IV size             11.59
                                   20% maximal IV size              8.75
                                   25% maximal IV size              7.25
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for i.i.d. errors only.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Kleibergen-Paap rk LM statistic          Chi-sq(1)=9.00     P-val=0.0027

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                     138.66
Kleibergen-Paap Wald rk F statistic                                13.47

Stock-Yogo weak ID test critical values for K1=2 and L1=2:
                                   10% maximal IV size              7.03
                                   15% maximal IV size              4.58
                                   20% maximal IV size              3.95
                                   25% maximal IV size              3.63
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(2,47)=        8.91     P-val=0.0005
Anderson-Rubin Wald test           Chi-sq(2)=     18.26     P-val=0.0001
Stock-Wright LM S statistic        Chi-sq(2)=     16.78     P-val=0.0002

NB: Underidentification, weak identification and weak-identification-robust
    test statistics cluster-robust

Number of clusters             N_clust  =         48
Number of observations               N  =        808
Number of regressors                 K  =          4
Number of endogenous regressors      K1 =          2
Number of instruments                L  =          4
Number of excluded instruments       L1 =          2

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on state

Number of clusters (state) =        48                Number of obs =      808
                                                      F(  3,    47) =     7.58
                                                      Prob > F      =   0.0003
Total (centered) SS     =  2216908.259                Centered R2   =  -0.0385
Total (uncentered) SS   =  2456100.942                Uncentered R2 =   0.0626
Residual SS             =  2302331.311                Root MSE      =    53.38

---------------------------------------------------------------------------------------
                      |               Robust
     Du_lane_miles_IH | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
----------------------+----------------------------------------------------------------
     exp_L_IH_SF12a_r |   .1152111   .0413616     2.79   0.005     .0341439    .1962782
exp_L_IH_SF12a_rXtime |  -.0023607   .0034533    -0.68   0.494    -.0091291    .0044076
                 time |  -.3527232   .4273719    -0.83   0.409    -1.190357    .4849103
                _cons |   6.212694   4.198405     1.48   0.139    -2.016029    14.44142
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):              8.996
                                                   Chi-sq(1) P-val =    0.0027
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              138.662
                         (Kleibergen-Paap rk Wald F statistic):         13.468
Stock-Yogo weak ID test critical values: 10% maximal IV size              7.03
                                         15% maximal IV size              4.58
                                         20% maximal IV size              3.95
                                         25% maximal IV size              3.63
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         exp_L_IH_SF12a_r exp_L_IH_SF12a_rXtime
Included instruments: time
Excluded instruments: L4FHWA_apport_LW_r L4FHWA_apport_LW_rXtime
------------------------------------------------------------------------------
(filter_10 stored)

.         sum_stats;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
Du_lane_mi~H |      1,171    22.87895    57.85622  -40.16399     687.82

added scalar:
e(mean_Du_lane_miles_IH) =  22.87895

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |      1,171    139.0182    209.4177   .3729714   2316.786

added scalar:
e(mean_exp_L_IH_SF12a_r) =  139.0182

.                 ren  exp_L_IH_SF12a_rXtime exp_L_IH_SF12a_rXtime_92;

.         ren time time_92 ;

.         ren time_old  time;

.         ren  exp_L_IH_SF12a_rXtime_old exp_L_IH_SF12a_rXtime;

.         ren  `IV'Xtime `IV'Xtime_92;

.         ren `IV'Xtime_old `IV'Xtime ;

.                 *change tex ->  csv if you want to see on excel;
.         esttab filter_1 filter_2 filter_3  filter_5  using "${output}/tables/Table3_universe_regressions.
> tex", replace
>         
>             star(+ 0.10 * 0.05 ** 0.01 *** 0.001) 
>                 b(%9.4fc) se(%9.4fc)  sfmt(%9.3fc)
>                 title("Construction expenditure and new lane miles\label{tab:table4}")
>                 indicate( "State FE=*state" )
>                 nomtitles  noomitted   nobaselevels 
>                 scalars(  "mean_Du_lane_miles_IH \(\Delta_t  \: L_{st}\)"
>                                   "mean_exp_L_IH_SF12a_r \(I^{L}_{st}\)") 
>                 substitute(\_ _
>                                         "State FE" "\cline{2-5}State FE")
>                 se  par  r2 label nogaps drop(_cons)  compress
>                 obslast stats(N widstat ,  fmt(%9.0fc %9.2fc) labels(`"N"' `"\(F\)"'))
>                         /* Only when exporting to tex*/
>                 `tex_settigns'
>                 ;
(output written to ..//tables/Table3_universe_regressions.tex)

.                                                                 *change tex ->  csv if you want to see on
>  excel;
.         esttab filter_9  using "${output}/tables/TableB2_universe_regressions.tex", replace
>         
>             star(+ 0.10 * 0.05 ** 0.01 *** 0.001) 
>                 b(%9.4fc) se(%9.4fc)  sfmt(%9.3fc)
>                 title("Construction expenditure and new lane miles, TSLS estimate\label{tab:tableB2}")
>                 
>                 nomtitles  noomitted   nobaselevels 
>                 scalars(  "mean_Du_lane_miles_IH \(\Delta_t  \: L_{st}\)"
>                                   "mean_exp_L_IH_SF12a_r \(I^{\ell}_{st}\)") 
>                 substitute(\_ _
>                                         "State FE" "\cline{2-6}State FE")
>                 se  par  r2 label nogaps drop(_cons)  compress
>                 obslast stats(N widstat ,  fmt(%9.0fc %9.2fc) labels(`"N"' `"\(F\)"'))
>                         /* Only when exporting to tex*/
>                 `tex_settigns'
>                 ;
(output written to ..//tables/TableB2_universe_regressions.tex)

.                                         *figures showing year indicators;
.         reg Du_lane_miles_IH c.exp_L_IH_SF12a_r#ibn.year `keep_rule', noc  cluster(state);

Linear regression                               Number of obs     =      1,171
                                                F(25, 47)         =      76.22
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1757
                                                Root MSE          =     57.078

                                            (Std. err. adjusted for 48 clusters in state)
-----------------------------------------------------------------------------------------
                        |               Robust
       Du_lane_miles_IH | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
year#c.exp_L_IH_SF12a_r |
                  1984  |   .3404294   .0836773     4.07   0.000     .1720925    .5087664
                  1985  |   .2029174   .0396859     5.11   0.000     .1230797    .2827551
                  1986  |   .2228359   .0571638     3.90   0.000     .1078372    .3378345
                  1987  |   .1782904   .0630662     2.83   0.007     .0514175    .3051633
                  1988  |   .1881153   .0573334     3.28   0.002     .0727754    .3034552
                  1989  |   .2414828   .0590762     4.09   0.000     .1226368    .3603288
                  1990  |   .1398198   .0430238     3.25   0.002     .0532671    .2263725
                  1991  |   .1022722   .0387255     2.64   0.011     .0243666    .1801778
                  1992  |   .1404918   .0610099     2.30   0.026     .0177558    .2632278
                  1993  |    .083461   .0366364     2.28   0.027      .009758     .157164
                  1994  |   .0666206   .0494315     1.35   0.184    -.0328228    .1660639
                  1995  |   .0556392   .0295274     1.88   0.066    -.0037623    .1150406
                  1996  |   .0762133   .0660356     1.15   0.254    -.0566331    .2090598
                  1997  |   .0382667   .0263761     1.45   0.153    -.0147952    .0913286
                  1998  |   .0777612    .030795     2.53   0.015     .0158096    .1397128
                  1999  |   .0508467   .0500854     1.02   0.315    -.0499122    .1516056
                  2000  |   .0254345   .0214402     1.19   0.241    -.0176977    .0685667
                  2001  |   .0462135   .0318141     1.45   0.153    -.0177882    .1102152
                  2002  |   .0413304    .023706     1.74   0.088    -.0063598    .0890207
                  2003  |    .035461   .0103863     3.41   0.001     .0145664    .0563556
                  2004  |   .0835124   .0328109     2.55   0.014     .0175055    .1495194
                  2005  |   .0854818   .0453242     1.89   0.065    -.0056987    .1766622
                  2006  |   .0433991   .0177473     2.45   0.018     .0076962    .0791019
                  2007  |   .0253788   .0141982     1.79   0.080    -.0031842    .0539419
                  2008  |   .0929313    .016793     5.53   0.000     .0591481    .1267145
-----------------------------------------------------------------------------------------

.         plot_dummies;
(file se.dta not found)
file se.dta saved

beta[1,25]
       1984.year#    1985.year#    1986.year#    1987.year#    1988.year#    1989.year#    1990.year#
    c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r
y1     .34042944      .2029174     .22283589     .17829039     .18811533      .2414828      .1398198

       1991.year#    1992.year#    1993.year#    1994.year#    1995.year#    1996.year#    1997.year#
    c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r
y1     .10227221     .14049177     .08346099     .06662058     .05563917     .07621334     .03826667

       1998.year#    1999.year#    2000.year#    2001.year#    2002.year#    2003.year#    2004.year#
    c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r
y1     .07776119      .0508467     .02543452     .04621348     .04133044     .03546103     .08351242

       2005.year#    2006.year#    2007.year#    2008.year#
    c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r  c.exp_L_IH~r
y1     .08548176     .04339905     .02537883      .0929313
Number of observations (_N) was 0, now 1.
1
number of observations will be reset to 1
Press any key to continue, or Break to abort
Number of observations (_N) was 0, now 1.
1
(j = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                1   ->   25          
Number of variables                  26   ->   3           
j variable (25 values)                    ->   year
xij variables:
                 beta1 beta2 ... beta25   ->   beta
-----------------------------------------------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                                25  (_merge==3)
    -----------------------------------------
(0 observations deleted)
(0 observations deleted)
variable year was byte now int
(25 real changes made)
(file beta.dta not found)
file beta.dta saved
(note:  named style med not found in class gsize, default attributes used)
file /Users/juanpablouribetrujillo/My Drive
    (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE/analysis/temp_t.pdf saved as PDF format
(file temp_betas.dta not found)
file temp_betas.dta saved

.         erase "temp_t.pdf";

.         copy "temp_betas.dta" "../intermediate_data/construction_betas_1.dta", replace ;

.         erase "temp_betas.dta";

.                 *The figure in the paper is created in the "optimality conditions dofile";
. eststo dir ;

-------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+-----------------------------------------------------
    filter_1 | regress   Du_lane_mi~H       2  Linear regression
    filter_2 | regress   Du_lane_mi~H      50  Linear regression
    filter_3 | regress   Du_lane_mi~H       4  Linear regression
    filter_4 | regress   Du_lane_mi~H       6  Linear regression
    filter_5 | regress   Du_lane_mi~H       4  Linear regression
    filter_6 | regress   Du_lane_mi~H      52  Linear regression
    filter_7 | regress   Du_lane_mi~H      54  Linear regression
    filter_8 | regress   Du_lane_mi~H      52  Linear regression
    filter_9 | ivreg2    Du_lane_mi~H       4  IV (2SLS) estimation
   filter_10 | ivreg2    Du_lane_mi~H       4  IV (2SLS) estimation
-------------------------------------------------------------------

. log close;
      name:  <unnamed>
       log:  /Users/juanpablouribetrujillo/My Drive (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE/analys
> is/../logs/universe_regressions.log
  log type:  text
 closed on:  24 Jun 2024, 22:25:12
-----------------------------------------------------------------------------------------------------------
